import time
from datetime import datetime

from django.db import models


# Create your models here.

class User(models.Model):
    id = models.AutoField(primary_key=True)
    username = models.CharField(max_length=50)
    password = models.CharField(max_length=50)
    age = models.IntegerField
    date_time = models.DateTimeField(default=datetime.now())

    class Meta:
        db_table = 'user'
        verbose_name = verbose_name_plural = '用户信息表'


class userToken(models.Model):
    id = models.AutoField(primary_key=True)
    username = models.OneToOneField(to='User',on_delete=models.CASCADE)
    token = models.CharField(max_length=120)
    date_time = models.DateTimeField(default=datetime.now())

    class Meta:
        db_table = 'user_token'
        verbose_name = verbose_name_plural = '用户token表'
